<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>访问CSS</title>
    <style>
        #d1{
            width: 200px;
            height: 100px;
            background-color: red;
        }
        .c1{
            background-color: green;
        }
    </style>
    <script>
        function f1(){
            let d1 = document.getElementById("d1");
            d1.className = "c1";
        }
        function f2(){
            let d2 = document.getElementById("d2");
            // d2.className = "c1";
            // d2.style.width = "400px";
            d2.style.height = "200px";
            d2.style.borderRadius = "50%"
            d2.style.backgroundColor = "green";
        }
        function f3(){
            let image = document.getElementById("image");
            image.style.left = parseInt(image.style.left) + 50 + "px";
        }
    </script>
</head>
<body>
<div id="d1" onclick="f1()"></div>
<hr>
<div id="d2" style="width: 200px;height: 100px;background-color: red;" onclick="f2()"></div>
<hr>
<img id="image" src="../images/heihei.gif" onmouseover="f3()" style="position: relative;left: 0px">
</body>
</html>